All Questions
8 questions
1vote
4answers
367views
Insert one file's content into another file and replace it between pattern
I have a file1.html: <!doctype html> <html> <head> </head> <body> text <!-- start-replacing --> <p>more text1</p> <p>more text2</p> ...
0votes
1answer
187views
Find and replace everything inside bracket using unix shell - several lines
I need to find and replace a big part of a json file using shell. For exemple I have this file : { "Balise1": true, "Balise2": true, "OtherThingEnabled": false, ...
1vote
2answers
166views
sed -Extended RegEx question here
I feel dumb as a sack of hammers asking this here, but it's been a long day and I simply CANNOT figure out what I'm doing wrong here. I have a file; we'll call it textfile.txt. It's contents are (in ...
0votes
1answer
1kviews
Output remote hostname in sshpass session
I have created a shell script to connect to a list of servers using sshpass and run a list of about 30 commands. An extract of the script is below. The script will wget a new config file, but then I ...
0votes
1answer
217views
Extracting multiple strings, according to a pattern, in a bash script
I'm writing a shell script to generate a directory listing. as an input a receive a long html string : https://www.mycompany.com/posts/aureliaflore_china-seoul-startup-activity-6571925510337728512-...
0votes
1answer
83views
Can you replace displayed text with something else in command window?
I am trying to manage user accounts. They are basically just numbers, but I would rather see user last names on the screen. Is it possible to automatically replace displayed text with something else? ...
3votes
2answers
3kviews
Replace a pattern in a file with a long string
I'm writing a little shell script to generate a directory listing. To make the output easily customizable, the script just builds a HTML-table and than should replace a specific token in a template ...
6votes
4answers
2kviews
sed how to substitute when string has "http://" in it?
I have a file xx that has the following contents: @base_url = "http://dmstaffing-stage.herokuapp.com/" I want to use sed to eliminate this line (replace with nothing). I have used this sed technique ...